<template>
  <el-container class="login-container">
    <el-row type="flex" class="row-bg" justify="center">
      <el-col :span="24">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>黑马登录</span>
          </div>
          <el-form ref="form" :model="form" label-width="80px">
            <el-form-item label="Username">
              <el-input v-model="form.username"></el-input>
            </el-form-item>
            <el-form-item label="Password">
              <el-input type="password" v-model="form.password"></el-input>
            </el-form-item>
            <el-form-item>
              <el-button type="primary" @click="login">Login</el-button>
            </el-form-item>
          </el-form>
        </el-card>
      </el-col>
    </el-row>
  </el-container>
</template>

<script>
export default {
  name: 'LogiN',
  data () {
    return {
      form: {
        username: '',
        password: ''
      }
    }
  },
  methods: {
    login () {
      // handle login
      console.log('Username:', this.form.username)
      console.log('Password:', this.form.password)
    }
  }
}
</script>

<style scoped>
.login-container {
  height: 100vh;
  background: #f2f2f2;
  display: flex;
  justify-content: center;
  align-items: center;
}

.row-bg {
  background: #fff;
}

.box-card {
  width: 100%;
  margin: 0 auto;
}
</style>
